
module.exports = function(grunt) {

    grunt.initConfig({
        pkg : grunt.file.readJSON('package.json'),
        jshint: {
            source: {
                src:['js/app.js']
            },
            min:{
                src:['dist/app.min.js']
            }
        },
        watch : {
            files: ['js/app.js'],
            tasks:['jshint']
        },
        concat: {
            options: {
              separator:'\n'
            },
            login : {
                files : {
                    'dist/login.min.js' : ['js/jquery.min.js','js/bootstrap.min.js','js/jquery.easing.min.js','js/angular.min.js','dist/app.min.js']
                }
            },
            index : {
                files : {
                    'dist/index.min.js' : ['js/jquery.min.js','js/bootstrap.min.js','js/angular.min.js','dist/app.min.js']
                }
            }
        },
        uglify: {
            options: {
                banner: '/* <%= pkg.name %> app.js build min js file <%= grunt.template.today("yyyy-mm-dd") %> */\n'
            },
            build : {
                options:{
                    mangle:false,
                    report:'min'
                },
                files:{
                    'dist/app.min.js':['js/app.js']
                }
            }
        }

    });

    grunt.loadNpmTasks('grunt-contrib-uglify');

    grunt.loadNpmTasks('grunt-contrib-concat');

    grunt.loadNpmTasks('grunt-contrib-jshint');

    grunt.loadNpmTasks('grunt-contrib-watch');

    grunt.registerTask('default',['uglify','concat:login','concat:index']);

}